3.2.26 \(\int \frac {(g \tan (e+f x))^p}{a+a \sin (e+f x)} \, dx\) [126]

Optimal. Leaf size=108 \[ \frac {(g \tan (e+f x))^{1+p}}{a f g (1+p)}-\frac {\cos ^2(e+f x)^{\frac {3+p}{2}} \, _2F_1\left (\frac {2+p}{2},\frac {3+p}{2};\frac {4+p}{2};\sin ^2(e+f x)\right ) \sec (e+f x) (g \tan (e+f x))^{2+p}}{a f g^2 (2+p)} \]

[Out]

(g*tan(f*x+e))^(1+p)/a/f/g/(1+p)-(cos(f*x+e)^2)^(3/2+1/2*p)*hypergeom([1+1/2*p, 3/2+1/2*p],[2+1/2*p],sin(f*x+e
)^2)*sec(f*x+e)*(g*tan(f*x+e))^(2+p)/a/f/g^2/(2+p)

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2785, 2687, 32, 2697} \begin {gather*} \frac {(g \tan (e+f x))^{p+1}}{a f g (p+1)}-\frac {\sec (e+f x) \cos ^2(e+f x)^{\frac {p+3}{2}} (g \tan (e+f x))^{p+2} \, _2F_1\left (\frac {p+2}{2},\frac {p+3}{2};\frac {p+4}{2};\sin ^2(e+f x)\right )}{a f g^2 (p+2)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(g*Tan[e + f*x])^p/(a + a*Sin[e + f*x]),x]

[Out]

(g*Tan[e + f*x])^(1 + p)/(a*f*g*(1 + p)) - ((Cos[e + f*x]^2)^((3 + p)/2)*Hypergeometric2F1[(2 + p)/2, (3 + p)/
2, (4 + p)/2, Sin[e + f*x]^2]*Sec[e + f*x]*(g*Tan[e + f*x])^(2 + p))/(a*f*g^2*(2 + p))

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 2687

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 2697

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*Sec[e + f
*x])^m*(b*Tan[e + f*x])^(n + 1)*((Cos[e + f*x]^2)^((m + n + 1)/2)/(b*f*(n + 1)))*Hypergeometric2F1[(n + 1)/2,
(m + n + 1)/2, (n + 3)/2, Sin[e + f*x]^2], x] /; FreeQ[{a, b, e, f, m, n}, x] &&  !IntegerQ[(n - 1)/2] &&  !In
tegerQ[m/2]

Rule 2785

Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/a, Int[S
ec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x] - Dist[1/(b*g), Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /;
FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]

Rubi steps

\begin {align*} \int \frac {(g \tan (e+f x))^p}{a+a \sin (e+f x)} \, dx &=\frac {\int \sec ^2(e+f x) (g \tan (e+f x))^p \, dx}{a}-\frac {\int \sec (e+f x) (g \tan (e+f x))^{1+p} \, dx}{a g}\\ &=-\frac {\cos ^2(e+f x)^{\frac {3+p}{2}} \, _2F_1\left (\frac {2+p}{2},\frac {3+p}{2};\frac {4+p}{2};\sin ^2(e+f x)\right ) \sec (e+f x) (g \tan (e+f x))^{2+p}}{a f g^2 (2+p)}+\frac {\text {Subst}\left (\int (g x)^p \, dx,x,\tan (e+f x)\right )}{a f}\\ &=\frac {(g \tan (e+f x))^{1+p}}{a f g (1+p)}-\frac {\cos ^2(e+f x)^{\frac {3+p}{2}} \, _2F_1\left (\frac {2+p}{2},\frac {3+p}{2};\frac {4+p}{2};\sin ^2(e+f x)\right ) \sec (e+f x) (g \tan (e+f x))^{2+p}}{a f g^2 (2+p)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(232\) vs. \(2(108)=216\).
time = 1.74, size = 232, normalized size = 2.15 \begin {gather*} \frac {2 \left (\cos (e+f x) \sec ^2\left (\frac {1}{2} (e+f x)\right )\right )^p \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2 \tan \left (\frac {1}{2} (e+f x)\right ) \left (\left (6+5 p+p^2\right ) \, _2F_1\left (\frac {1+p}{2},2+p;\frac {3+p}{2};\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )-(1+p) \tan \left (\frac {1}{2} (e+f x)\right ) \left (2 (3+p) \, _2F_1\left (\frac {2+p}{2},2+p;\frac {4+p}{2};\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )-(2+p) \, _2F_1\left (2+p,\frac {3+p}{2};\frac {5+p}{2};\tan ^2\left (\frac {1}{2} (e+f x)\right )\right ) \tan \left (\frac {1}{2} (e+f x)\right )\right )\right ) (g \tan (e+f x))^p}{f (1+p) (2+p) (3+p) (a+a \sin (e+f x))} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[(g*Tan[e + f*x])^p/(a + a*Sin[e + f*x]),x]

[Out]

(2*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^p*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2*Tan[(e + f*x)/2]*((6 + 5*p + p^
2)*Hypergeometric2F1[(1 + p)/2, 2 + p, (3 + p)/2, Tan[(e + f*x)/2]^2] - (1 + p)*Tan[(e + f*x)/2]*(2*(3 + p)*Hy
pergeometric2F1[(2 + p)/2, 2 + p, (4 + p)/2, Tan[(e + f*x)/2]^2] - (2 + p)*Hypergeometric2F1[2 + p, (3 + p)/2,
 (5 + p)/2, Tan[(e + f*x)/2]^2]*Tan[(e + f*x)/2]))*(g*Tan[e + f*x])^p)/(f*(1 + p)*(2 + p)*(3 + p)*(a + a*Sin[e
 + f*x]))

________________________________________________________________________________________

Maple [F]
time = 0.30, size = 0, normalized size = 0.00 \[\int \frac {\left (g \tan \left (f x +e \right )\right )^{p}}{a +a \sin \left (f x +e \right )}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*tan(f*x+e))^p/(a+a*sin(f*x+e)),x)

[Out]

int((g*tan(f*x+e))^p/(a+a*sin(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*tan(f*x+e))^p/(a+a*sin(f*x+e)),x, algorithm="maxima")

[Out]

integrate((g*tan(f*x + e))^p/(a*sin(f*x + e) + a), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*tan(f*x+e))^p/(a+a*sin(f*x+e)),x, algorithm="fricas")

[Out]

integral((g*tan(f*x + e))^p/(a*sin(f*x + e) + a), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\left (g \tan {\left (e + f x \right )}\right )^{p}}{\sin {\left (e + f x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*tan(f*x+e))**p/(a+a*sin(f*x+e)),x)

[Out]

Integral((g*tan(e + f*x))**p/(sin(e + f*x) + 1), x)/a

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*tan(f*x+e))^p/(a+a*sin(f*x+e)),x, algorithm="giac")

[Out]

integrate((g*tan(f*x + e))^p/(a*sin(f*x + e) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (g\,\mathrm {tan}\left (e+f\,x\right )\right )}^p}{a+a\,\sin \left (e+f\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*tan(e + f*x))^p/(a + a*sin(e + f*x)),x)

[Out]

int((g*tan(e + f*x))^p/(a + a*sin(e + f*x)), x)

________________________________________________________________________________________